package rpg.state
{
	import rpg.Utils.Val;
	import rpg.role.Hero;

	public class Dead extends StateBase
	{
		public function Dead(hero : Hero , stateMachine : StateComponent)
		{
			super(hero , stateMachine);
			stateID = Val.DEAD;
		}

		/**
		 * 更新动作
		 * @param delay
		 *
		 */
		override public function update(delay : uint) : void
		{
			if(role.state != Val.DEAD)
				role.state = Val.DEAD;
			if(role.avatarComponent.isEnd)
			{
				role.destroy();
			}
		}

	}
}